<?php
	require 'smtp.class.php';
	
	$smtpserver = "smtp.qq.com";//SMTP服务器
	$smtpserverport =25;//SMTP服务器端口
	$smtpusermail = "1379502713@qq.com";//SMTP服务器的用户邮箱
	
	$smtpemailto = $_GET['to'] ? $_GET['to'] : "137992916@qq.com";//发送给谁
	$smtpuser = "1379502713@qq.com";//SMTP服务器的用户帐号
	$smtppass = "3141592652";//SMTP服务器的用户密码
	$mailsubject = "桑讯网建站大酬宾活动";//邮件主题
	$mailbody = file_get_contents('content.html');//邮件内容
	
	// 解决乱码问题
	$mailsubject = iconv( "utf-8", "gbk", $mailsubject); 
	$mailbody = iconv( "utf-8", "gbk", $mailbody); 
	//$mailbody = "=?UTF-8?B?".base64_encode($mailbody)."?=";
	
	$mailtype = "HTML";//邮件格式（HTML/TXT）,TXT为文本邮件
	$smtp = new smtp($smtpserver,$smtpserverport,true,$smtpuser,$smtppass);
	//$smtp->debug = TRUE;//是否显示发送的调试信息
	
	if($smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype)){
		echo("true");
	}
	else{
		echo("false");
	}
?>

<form action="./" method="get">
	<input name="to" type="text" id="to" />
    <input name="submit" type="submit" value="sendmail" />
</form>